﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using YAPACS.RisServer.Abstractions;
using YAPACS.RisServer.Services.Dtos;

namespace YAPACS.RisServer.Controllers;
[Authorize]
public class TabPanelController : AbpControllerBase
{
    private readonly ITabPanelService _tabPanelService;

    public TabPanelController(ITabPanelService tabPanelService)
    {
        _tabPanelService = tabPanelService;
    }

    [HttpPost]
    [Route("api/report/get-exam-histories/{reportId}")]
    public async Task<IActionResult> GetExamHistoriesAsync(Guid reportId, [FromBody] DataGridRequest request)
    {
        var result = await _tabPanelService.GetExamHistoriesAsync(reportId, request);
        return Ok(result);
    }
    [HttpPost]
    [Route("api/report/get-exam-forms/{reportId}")]
    public async Task<IActionResult> GetExamFormsAsync(Guid reportId, [FromBody] DataGridRequest request)
    {
        var result = await _tabPanelService.GetExamFormsAsync(reportId, request);
        return Ok(result);
    }
    [HttpPost]
    [Route("api/report/get-exam-events/{reportId}")]
    public async Task<IActionResult> GetExamEventsAsync(Guid reportId, [FromBody] DataGridRequest request)
    {
        var result = await _tabPanelService.GetExamEventsAsync(reportId, request);
        return Ok(result);
    }
    [HttpPost]
    [Route("api/report/get-exam-remarks/{reportId}")]
    public async Task<IActionResult> GetExamRemarksAsync(Guid reportId, [FromBody] DataGridRequest request)
    {
        var result = await _tabPanelService.GetExamRemarksAsync(reportId, request);
        return Ok(result);
    }
    [HttpGet]
    [Route("api/report/get-queue-advanced-search-view")]
    public async Task<IActionResult> GetQueueAdvancedSearchViewAsync()
    {
        var result = await _tabPanelService.GetQueueAdvancedSearchViewAsync();
        return Ok(result);
    }
    [HttpPost]
    [Route("api/report/get-queues")]
    public async Task<IActionResult> GetQueuesAsync([FromBody] DataGridRequest request)
    {
        var result = await _tabPanelService.GetQueuesAsync(request);
        return Ok(result);
    }
    [HttpGet]
    [Route("api/report/get-exam-advanced-search-view")]
    public async Task<IActionResult> GetExamAdvancedSearchViewAsync()
    {
        var result = await _tabPanelService.GetExamAdvancedSearchViewAsync();
        return Ok(result);
    }
    [HttpPost]
    [Route("api/report/get-exams")]
    public async Task<IActionResult> GetExamsAsync([FromBody] DataGridRequest request)
    {
        var result = await _tabPanelService.GetExamsAsync(request);
        return Ok(result);
    }
}
